********************************************************************************************************************
README file for 'The impact of Covid-19 on productivity', published in Review of Economics and Statistics, 2022  
Nicholas Bloom, Philip Bunn, Paul Mizen, Pawel Smietanka, Gregory Thwaites	
********************************************************************************************************************


This file describes the replication files for the above paper.

The paper uses two proprietary datasets: (i) firm survey data from the Decision Maker Panel (DMP); and (ii) company 
accounts data from Bureau van Dijk FAME database (BVD). The terms of our access to the underlying microdata from these 
two datasets does not allow them to be included in the posted replication files.  

DMP microdata are available via the UK Office for National Statistics' Secure Research Service datalab. Further details of 
how to access this data are provided below. BVD are a commercial data provider and the terms of our licence do not allow 
us to share the underlying microdata. However, the replication files do include details of how to produce a close 
approximation of the main results using the DMP microdata but without using BVD data. Here, the main input from BVD
(the level of pre-Covid productivity at the firm level) is imputed using industry data (which is included in the replication 
files) and other variables in the DMP data.

All other data used in the paper and all code files are included in the replication files. There are 22 posted replication 
files. The notes below explain all of the posted replication files in more detail.  All data were last updated on 29/9/2022.

List of posted replication files:

	> README.txt
	> Charts for Covid and productivity RESTAT paper.xlsx
	> Do file for impact of Covid-19 on productivity.do
	> Stata log file for impact of Covid on productivity.txt
	> ONS data downloads.xlsx
	> UK TFP data.xlsx
	> US labor productivity data.xlsx
	> US quarterly_tfp.xlsx
	> Lockdown stringency data.xlsx
	> Entry and exit data.xlsx
	> HMRC furlough data.xlsx
	> UK and US industrial composition.xlsx
	> ONS detailed output per job.xlsx
	> ONS market sector hours worked.xlsx 
	> ONS hours adjustment.xlsx
	> ONS input output tables.xlsx 
	> 2019 business population estimates.xlsx 
	> Teleworking by industry.xlsx 
	> DMP variable list August 2016 to April 2022.xlsx
	> Instructions for approximately replicating results.docx 
	> Coefficients for productivity imputation.xlsx
	> BVD pre Covid productivity by industry.xlsx

DMP microdata can be accessed via the Secure Research Service (SRS). Further details are available on the DMP website:
https://decisionmakerpanel.co.uk/data/
Further information on the SRS and details of how to apply are available on the ONS website:
https://www.ons.gov.uk/aboutus/whatwedo/statistics/requestingstatistics/secureresearchservice
 
Researchers wishing to access the DMP data in this way should apply for an accredited research project via the ONS website.  
Project applications, research outputs and publications will need to be approved by the ONS and Bank of England.  
All projects using the DMP data should be for the public good and should help the Bank of England to fulfil its functions.  
The data will only be made available for non-commercial reasons to academics, Bank/government economists and others in similar roles.
Data will be made available for research projects providing that they: (i) maintain the confidentiality of the data; 
and (ii) do not significantly overlap with ongoing unpublished projects that the DMP team are working on/planning on 
at the point the proposal is submitted (replication/extension of published papers is permitted).


********************************************************************************************************************
Charts for Covid and productivity RESTAT paper.xlsx
********************************************************************************************************************

This file contains most of the Figures and Tables in the paper. Charts not included in this files are all produced in Stata 
(these are Figure 6 Panel A, Figure A3, Figure A7) except Figure A5 which is a screenshot from the survey software, Qualtrics.

The list below explains where the data for each figure/table come from, in some cases there are additional tranformations 
applied in the excel file.
All hard pasted data within the excel file should be from the Stata output file unless otherwise stated.
All hard pasted data should have a light blue background.  Figures with a yellow or grey background are used in the paper.

Figure 1: Estimates of the impact of Covid-19 on productivity
	> DMP UK productivity impacts are as per Figure 4
	> ONS UK productivity impacts are based on 'ONS data downloads.xlsx', 'UK TFP data.xlsx' and 'ONS hours adjustment.xlsx'
	> US labor productivity impacts are based on 'US labor productivity data.xlsx'
	> US TFP impacts are based on 'US quarterly_tfp.xlsx'
	> ONS UK and US productivity impacts are calculated relative to a counterfactual of 1% annual productivity 
	  growth (calculations done in the spreadsheet)

Figure 2: Measures of lockdown stringency and mortality
	> Lockdown stringency data and excess mortality data are based on 'Lockdown stringency data.xlsx'

Figure 3: Impact of Covid-19 on businesses
	> Stata output from 'Do file for impact of Covid-19 on productivity.do'
        > 2020 Q1 data based on 'ONS data downloads.xlsx'

Figure 4: Within and between-firm contributions to Covid-19 productivity impact
	> Stata output from 'Do file for impact of Covid-19 on productivity.do' for within and between industry effects
	> Entry and exit impacts are calculated in the spreadsheet based on data for Figure A12 and Table A3
	> Total impacts are calculated within the spreadsheet

Figure 5: Covid-related influences on longer-term productivity
	> Stata output from 'Do file for impact of Covid-19 on productivity.do'

Figure 6: Heterogeneity of impacts on TFP
	> Stata output from 'Do file for impact of Covid-19 on productivity.do'

Figure 7: Firm entry and exit rates
	> Entry and exit data are based on 'Entry and exit data.xlsx' and 'ONS data downloads.xlsx'
	> Employment weighted birth and death rate data are calculated from employment in entering/exiting firms over private sector employee jobs
	> Non-seasonally adjusted data are seasonally adjusted by the authors using Eviews 11 and Census-X12 method

Figure 8: Potential impact of Covid-related quality changes on TFP
	> Stata output from 'Do file for impact of Covid-19 on productivity.do'

Table 1: Covid-19 impacts and Covid exposure measures
	> Stata output from 'Do file for impact of Covid-19 on productivity.do'

Table 2: Impact of Covid-19 on hours worked and pre-Covid productivity
	> Stata output from 'Do file for impact of Covid-19 on productivity.do'

Figure A1: Measures of hours worked and implications for productivity
	> DMP UK productivity impacts are as per Figure 4
	> DMP furlough data are from 'Do file for impact of Covid-19 on productivity.do'
	> HMRC furlough data are from 'HMRC furlough data.xlsx'
	> ONS market sector hours worked data are based on 'ONS market sector hours worked.xlsx' and 'ONS hours adjustment.xlsx'

Figure A2: DMP response rate
	> Stata output from 'Do file for impact of Covid-19 on productivity.do'

Figure A3: DMP data versus company accounts data
	> Stata output from 'Do file for impact of Covid-19 on productivity.do'

Figure A4: Industrial composition of the UK and US economies
	> Based on 'UK and US industrial composition.xlsx'

Figure A5: Example survey question on impact of Covid-19
	> Screenshot from DMP survey software

Figure A6: Different measures of industry-level labor productivity
	> Accounts data are Stata output from 'Do file for impact of Covid-19 on productivity.do'
	> ONS labor productivity per job data from 'ONS detailed output per job.xlsx'

Figure A7: Productivity from DMP and accounts during financial year 2020
	> Stata output from 'Do file for impact of Covid-19 on productivity.do'

Figure A8: Impact of Covid-19 on labor productivity per worker (including furloughed workers)
	> Stata output from 'Do file for impact of Covid-19 on productivity.do'

Figure A9: Contributions to impact of Covid-19 on within-firm productivity 
	> Stata output from 'Do file for impact of Covid-19 on productivity.do'

Figure A10: Impact of Covid-19 on hours worked and pre-Covid productivity
	> Stata output from 'Do file for impact of Covid-19 on productivity.do'

Figure A11: Impact of Covid-19 on hours worked and capital by industry
	> Stata output from 'Do file for impact of Covid-19 on productivity.do'

Figure A12: Firm entry/exit and impact on productivity
	> Employment weighted entry and exit data are based on 'Entry and exit data.xlsx'
	> Non-seasonally adjusted data are seasonally adjusted by the authors using Eviews 11 and Census-X12 method
	> Entry and exit impacts in Panel B are calculated in the spreadsheet based on data for Figure A12 Panel A and Table A3
	> Entry and exit rates are in 2022 H2 are assumed to be the same as 2022 H1, then go back to their 2019 averages

Figure A13: Confidence intervals around estimated productivity impacts
	> Stata output from 'Do file for impact of Covid-19 on productivity.do'

Figure A14: TFP impacts sensitivity analysis
	> Stata output from 'Do file for impact of Covid-19 on productivity.do'

Table A1: Linear probability models for propensity to respond to the DMP 
	> Stata output from 'Do file for impact of Covid-19 on productivity.do'

Table A2: Summary of estimated impact of Covid-19 on productivity
	> This is just a tabular version of Figure 4

Table A3: Firm entry/exit and productivity
	> Stata output from 'Do file for impact of Covid-19 on productivity.do'


********************************************************************************************************************
Do file for impact of Covid-19 on productivity.do
********************************************************************************************************************

Run using Stata 15MP.

The structure of the do file is as follows:
- First import various aggregate data files into Stata to merge later on
- Then prepare BVD company accounts data
- Next, calculate within firm Covid productivity impacts from the DMP data
- Then merge all the different datasets together
- Once all data is set up, the analysis is carried out 
- The final section is on approximately replicating results without BVD data

The do file contains notes explaining what each part of the code is doing and which Figures/Tables and output is for


********************************************************************************************************************
Stata log file for impact of Covid on productivity.txt
********************************************************************************************************************

A Stata output file showing the output produced by running 'Do file for impact of Covid-19 on productivity.do'


********************************************************************************************************************
ONS data downloads.xlsx
********************************************************************************************************************

UK aggregate time series data downloaded from the Office for National Statistics' (ONS) website

Market sector output per hour (GYY7):
https://www.ons.gov.uk/employmentandlabourmarket/peopleinwork/labourproductivity/timeseries/gyy7/prdy

Business investment (NPEL):
https://www.ons.gov.uk/economy/grossdomesticproductgdp/timeseries/npel/pn2

Employee jobs (BCAJ):
https://www.ons.gov.uk/employmentandlabourmarket/peopleinwork/employmentandemployeetypes/timeseries/bcaj/lms

Public sector employment (G7AU):
https://www.ons.gov.uk/employmentandlabourmarket/peopleinwork/employmentandemployeetypes/timeseries/g7au/lms

GDP deflator (YBGB):
https://www.ons.gov.uk/economy/grossdomesticproductgdp/timeseries/ybgb/pn2


********************************************************************************************************************
UK TFP data.xlsx
********************************************************************************************************************

Data on UK TFP downloaded from ONS website:
https://www.ons.gov.uk/file?uri=/economy/economicoutputandproductivity/productivitymeasures/datasets/growthaccountingquarterlyuk/7july2022/growthaccountingquarterly.xlsx
Market sector GVA series is taken from 'Table_1' column B
Market sector TFP series is taken from 'Table_7' column B
Market sector labour weight share is taken from 'Table_10' column B
Industry level labour weight shares are calculated in 'Table_10', data to load into Stata is in the 'Stata' tab

Jobs data tab is taken from 'ONS detailed output per job.xlsx and is used to weight together labour factor shares for other production.


********************************************************************************************************************
US labor productivity data.xlsx
********************************************************************************************************************

US hourly labor productivitiy data
Downloaded from: https://fred.stlouisfed.org/series/OPHNFB#0
Nonfarm Business Sector: Labor Productivity (Output per Hour) for All Employed Persons, Index 2012=100, Quarterly, Seasonally Adjusted


********************************************************************************************************************
US quarterly_tfp.xlsx
********************************************************************************************************************

US TFP data downloaded from:
https://www.frbsf.org/wp-content/uploads/sites/4/quarterly_tfp.xlsx
Series used as an input into Figure 1 is 'dtfp' (column L)  in the 'quarterly' tab
See John G. Fernald, "A Quarterly, Utilization-Adjusted Series on Total Factor Productivity." FRBSF Working Paper 2012-19 (updated March 2014).


********************************************************************************************************************
Lockdown stringency data.xlsx
********************************************************************************************************************

Data downloaded from 
https://github.com/owid/covid-19-data/tree/master/public/data
Stringency data: https://ourworldindata.org/grapher/covid-stringency-index?tab=chart 
Excess mortality: https://ourworldindata.org/excess-mortality-covid#excess-mortality-our-data-sources
Only data for the US and UK are included in this spreadsheet.
Stringency data used in Figure 2 are taken from column AV in the 'Data' tab
Excess mortality data used in Figure 2 are from column BN in the 'Data' tab
Lockdown stringency data are from the Oxford Covid-19 Government Response Tracker. 
Excess mortality data are from the Human Mortality Database and World Mortality Dataset.


********************************************************************************************************************
Entry and exit data.xlsx
********************************************************************************************************************

Data downloaded from ONS website:
https://www.ons.gov.uk/file?uri=/businessindustryandtrade/business/activitysizeandlocation/datasets/businessdemographyquarterlyexperimentalstatisticsuk/quarter2apriltojune2022/q22022qdemtables.xlsx
Data used refer to employment in businesses that are born and businesses that are die in each quarter
Employment in firms who are born is from the 'Births Total Emp' tab
Employment in firms who die are from the 'Deaths Total Emp' tab


********************************************************************************************************************
HMRC furlough data.xlsx
********************************************************************************************************************

This file contains data on the percentage of workers on furlough (still employed but not required to work any hours)
Original spreadsheet downloaded from:	
https://www.gov.uk/government/statistics/coronavirus-job-retention-scheme-statistics-16-december-2021	
Published data are daily	
Daily data are converted into quarterly data in the 'Quarterly data' tab	
Between March 2020 and end June 2020 all furlough was full time
Workers could not be put on furlough before 1 March 2020
The furlough scheme ended on 30 September 2021
Where type of furlough is unknown, it is allocated between full and partial in line with known shares for that period
Data in column P of the 'Quarterly data' tab are used as an input into Figure A1 in 'Charts for Covid and productivity RESTAT paper.xlsx'


********************************************************************************************************************
UK and US industrial composition.xlsx
********************************************************************************************************************

Data downloaded from OECD database:
https://data.oecd.org/natincome/value-added-by-activity.htm#indicator-chart
doi: 10.1787/a8b2bd2b-en
Value added by activity data for UK and US in 2019 are selected from the full database


********************************************************************************************************************
ONS detailed output per job.xlsx
********************************************************************************************************************

Data downloaded from ONS website:
https://www.ons.gov.uk/economy/economicoutputandproductivity/productivitymeasures/datasets/outputperjobuk
Used to calculate output per job by industry in Figure A6 (see Table_19 tab for calculations to match DMP industry definitions)


********************************************************************************************************************
ONS market sector hours worked.xlsx
********************************************************************************************************************

Data downloaded from ONS website:
https://www.ons.gov.uk/file?uri=/employmentandlabourmarket/peopleinwork/labourproductivity/datasets/productivityjobsproductivityhoursmarketsectorworkersmarketsectorhours/current/lprod02.xls
Data on market sector hours worked in 'Market sector hours SA' tab, column B are used in Figure A1


********************************************************************************************************************
ONS hours adjustment.xlsx
********************************************************************************************************************

Data downloaded from ONS website:
https://www.ons.gov.uk/generator?uri=/economy/economicoutputandproductivity/productivitymeasures/articles/impactoflabourforcesurveymethodologicalchangesonlabourproductivityuk/2021-09-09/b8bbbe4d&format=xls
They are the data behind Figure 4 in the above article: Impact of Labour Force Survey methodological changes on labour productivity, UK
In particular the article provides an overview of changes to Labour Force Survey (LFS) methods as a result of the coronavirus pandemic, and their impacts on productivity statistics in 2020 and 2021.					
ONS adjusted hours worked are based on an experimental series that imputes missing values for hours worked during the Covid pandemic using people with similar characteristics rather than by carrying forward previous (often pre-Covid) responses for that person					
The official data impute missing data by carrying forward previous pre-pandemic responses, which is likely to have understated the fall in hours worked in the early part of the pandemic					

Data in cells B30:C35 are used to adjust official statistics in 'Charts for Covid and productivity RESTAT paper.xlsx'
These adjustments refer to the whole economy, but are assumed to be the same for the market sector


********************************************************************************************************************
ONS input output tables.xlsx 
********************************************************************************************************************

Data downloaded from ONS website:
https://www.ons.gov.uk/file?uri=/economy/nationalaccounts/supplyandusetables/datasets/ukinputoutputanalyticaltablesdetailed/2018/nasu1719pr.xlsx
Data are input output analytical tables for the UK
Used to calculate the importance of intermediate costs at industry level
This is used as an input in the productivity calculations in Stata to map DMP sales and cost impacts into GVA space
Data are for 2018 (latest available data)
Calculations are in the 'Use BP PxI' tab
Data to load into Stata for calculations are in the 'Stata' tab and are saved as 'ONS industry cost shares.dta'


********************************************************************************************************************
2019 business population estimates.xlsx 
********************************************************************************************************************

Data on the structure of the business population in 2019 downloaded from ONS website:
https://www.gov.uk/government/statistics/business-population-estimates-2019
Data are used to construct weights that ensure the DMP data are representative of the UK business population
Only tabs that are relevant to the paper are included in this version.
Calculations in the 'Table 5' tab calculate employment shares using DMP industry definitions and split by firms with 10-249 employees and 250+.
The data in 'Stata 1' tab are the data on employment share by industry to be loaded into Stata.
The data in 'Stata 2' tab are the data on employment share by industry and firm size to be loaded into Stata.


********************************************************************************************************************
Teleworking by industry.xlsx 
********************************************************************************************************************

Data on the share of jobs that can be done from home
Taken from Dingel, J.I. and B. Neiman, (2020), “How Many Jobs Can be Done at Home?”, Journal of Public Economics, 189, article 104235
https://www.sciencedirect.com/science/article/pii/S0047272720300992
Data to load into Stata for calculations are in the 'Stata' tab


********************************************************************************************************************
DMP variable list August 2016 to April 2022.xlsx
********************************************************************************************************************

An excel file containing a list of variables in the DMP survey that are available in the Secure Research Service.
This includes all DMP variables required for this paper.


********************************************************************************************************************
Instructions for approximately replicating results.docx 
********************************************************************************************************************

This file contains instructions to approximately replicate the main results in the paper using only DMP microdata and other
aggregated data and not BVD firm level data.  Here, the main input from BVD (the level of pre-Covid productivity at 
the firm level) is imputed using industry data (which is included in the replication files) and other variables in the DMP data.


********************************************************************************************************************
Coefficients for productivity imputation.xlsx
********************************************************************************************************************

This file contains the coefficients to impute measures of pre-Covid firm level productivity.
These coefficients are loaded into Stata to carry out the imputation in the main do file.
The variable ind2 is the industry variable.
Lower case variable names refer to labour productivity imputation, upper case are for TFP imputation.
Variables c and CI are the constants.
Variables a and A1 are the industry fixed effects.
Variables b1-b12 and B1-B12 are the coefficients on Covid impact on hours worked in different periods.
See 'Instructions for approximately replicating results.doc' for more explanation of this imputation process.


********************************************************************************************************************
BVD pre Covid productivity by industry.xlsx
********************************************************************************************************************

This file contains industry level labour productivity (prod_last_ind) and tfp in 2019 (tfp2_last_ind)
The industry calculated by employment weighting the firm level data
These data are calculated from BVD company accounts data and are for the sample of firms used in the paper
See the Stata do file for more information on exactly how these variables are calculated

